home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-6.dms / in.adf / Install.run / GOLDEDDATA / developer / golded / include / golded.h
Encoding:
C/C++ Source or Header  |  1996-09-02  |  7.9 KB  |  198 lines

  1. #ifndef GOLDED_CONFIG_H
  2. #define GOLDED_CONFIG_H
  3. /*
  4. **      $Filename: fd/GoldED.h
  5. **      $Release: 6
  6. **
  7. **      GoldED includes
  8. **
  9. **      (C) Copyright 1996 Dietmar Eilert
  10. **          All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include <exec/lists.h>
  19. #endif
  20.  
  21. #ifndef EXEC_LISTS_H
  22. #include <exec/lists.h>
  23. #endif
  24.  
  25. #ifndef INTUITION_INTUITION_H
  26. #include <intuition/intuition.h>
  27. #endif
  28.  
  29. #ifndef UTILITY_TAGITEM_H
  30. #include <utility/tagitem.h>
  31. #endif
  32.  
  33. #ifndef WORKBENCH_WORKBENCH_H
  34. #include <workbench/workbench.h>
  35. #endif
  36.  
  37. #ifndef REXX_STORAGE_H
  38. #include <rexx/storage.h>
  39. #endif
  40.  
  41. /*
  42.  
  43.   Peferences of text buffer (suggest use: read-only); a pointer to this structure
  44.   can be found in APIMessages: APIMessages->APIInstance->api_Environment.
  45.  
  46. */
  47.  
  48. struct EditConfig {
  49.  
  50.     struct Node         Node;                        /* it's a linked list */
  51.     ULONG               Magic;                       /* useful to scan memory for this number */
  52.     UBYTE               Name[141];                   /* document's name      (symbolic) */
  53.     UBYTE               Path[141];                   /* document's directory (symbolic) */
  54.     BOOL                ValidName;                   /* file named ? */
  55.     BOOL                ReadOnly;                    /* text is read-only */
  56.     struct LineNode    *TextNodes;                   /* pointer to 1st line's node */
  57.     BOOL                Folds;                       /* any folds ? */
  58.     ULONG               MaxLines;                    /* size of dynamic nodes array */
  59.     ULONG               Lines;                       /* number of lines    (abs) */
  60.     ULONG               Line;                        /* current line number */
  61.     UWORD               Column;                      /* cursor x position (abs) */
  62.     UWORD               LastChangeColumn;            /* column of last change */
  63.     ULONG               LastChangeLine;              /* line of last change */
  64.     UBYTE              *CurrentBuffer;               /* pointer to current line buffer */
  65.     UWORD               CurrentLen;                  /* bytes in buffer */
  66.     UBYTE              *UndoBuffer;                  /* pointer undo buffer */
  67.     UWORD               UndoLen;                     /* bytes in undo buffer */
  68.     ULONG               UndoLine;                    /* line number of undo buffer */
  69.     BOOL                LineModified;                /* flag: line   has been modified */
  70.     BOOL                DocModified;                 /* flag: buffer has been modified */
  71.     UWORD               Marker;                      /* marker mode */
  72.     BOOL                FlowMark;                    /* marker ink flow while moving ? */
  73.     UWORD               BlockStartX;                 /* block start */
  74.     ULONG               BlockStartY;                 /* block start */
  75.     UWORD               BlockEndX;                   /* block end */
  76.     ULONG               BlockEndY;                   /* block end */
  77.     ULONG               SearchLine;                  /* find start: line */
  78.     UWORD               SearchColumn;                /* find start: column */
  79.     ULONG               Protection;                  /* protection bits */
  80.     BOOL                LineNotFixed;                /* line-may-be-changed flag */
  81.     UWORD               BackupCounter;               /* backup timer [min] */
  82.     BOOL                Preview;                     /* preview active ? */
  83.     BOOL                Frozen;                      /* text frozen ? */
  84.     UBYTE               Comment[80];                 /* file comment */
  85.     ULONG               RememberY[10];               /* ping/pong jump marker */
  86.     ULONG               RememberX[10];               /* ping/pong jump marker */
  87.  
  88.     /* more private stuff follows */
  89. };
  90.  
  91. /* marker modes */
  92.  
  93. #define BLOCKMODE_NONE    0L
  94. #define BLOCKMODE_LINE    1L
  95. #define BLOCKMODE_CHAR    2L
  96.  
  97. /* each line of a text is described by a line node */
  98.  
  99. struct LineNode {
  100.  
  101.     UWORD                 Len;                       /* line's length */
  102.     ULONG                 Line;                      /* locked line number */
  103.     UBYTE                *Text;                      /* pointer to text data */
  104.     struct SpecialInfo   *SpecialInfo;               /* pointer to node extension */
  105.     APTR                  UserData;                  /* syntax parser data */
  106. };
  107.  
  108. /* node extensions are attached to line nodes to store special data */
  109.  
  110. struct SpecialInfo {
  111.  
  112.     UWORD                 ID;                        /* extension ID (see below) */
  113.  
  114.     /* extension specific data follows */
  115. };
  116.  
  117. #define EXTENSION_FOLD    0L                         /* fold */
  118. #define EXTENSION_BREAK   1L                         /* breakpoint */
  119.  
  120. /* some useful macros */
  121.  
  122. #define IS_FOLD(a)        ((a)->SpecialInfo  && ((a)->SpecialInfo->ID == EXTENSION_FOLD ))
  123. #define IS_BREAK(a)       ((a)->SpecialInfo  && ((a)->SpecialInfo->ID == EXTENSION_BREAK))
  124.  
  125. #define GET_FOLD(a)       (((a)->SpecialInfo && ((a)->SpecialInfo->ID == EXTENSION_FOLD )) ? ((struct Fold       *)(a)->SpecialInfo) : NULL)
  126. #define GET_BREAKPOINT(a) (((a)->SpecialInfo && ((a)->SpecialInfo->ID == EXTENSION_BREAK)) ? ((struct Breakpoint *)(a)->SpecialInfo) : NULL)
  127.  
  128. /* node extensions (extended SpecialInfo blocks) */
  129.  
  130. struct Fold {
  131.  
  132.     UWORD                 ID;                        /* ID: NODE_EXTENSION_FOLD */
  133.     ULONG                 Lines;                     /* lines within folded block */
  134.     struct LineNode      *TextNodes;                 /* pointer to node of 1st line */
  135. };
  136.  
  137. struct BreakPoint {
  138.  
  139.     UWORD                 ID;                        /* ID: NODE_EXTENSION_BREAK */
  140.     ULONG                 Line;                      /* absolute line number */
  141.     UWORD                 State;                     /* current breakpoint state */
  142. };
  143.  
  144.  
  145. /* preferences of text windows (read-only); attached to Window->UserData  */
  146.  
  147. struct WindowSupportInfo {
  148.  
  149.     struct Node           Node;                      /* it's a linked list */
  150.     struct Window        *Window;                    /* associated window */
  151.     struct EditConfig    *EditConfig;                /* text buffer (if any) */
  152.     UWORD                 Sleep;                     /* >0: show busy pointer */
  153.     struct Menu          *Menu;                      /* menu bar (if any) */
  154.     struct Gadget        *GadgetList;                /* pointer to 1st gadget (if any) */
  155.  
  156.     /* handler (cleanup, server) */
  157.  
  158.     void (*CleanUp)(APTR);
  159.     void (*Server )(struct Window *, UWORD, APTR);
  160.  
  161.     /* window dimensions */
  162.  
  163.     UWORD                 Type;                      /* window/server type */
  164.     UWORD                 Left;                      /* window position    */
  165.     UWORD                 Top;                       /* window position    */
  166.     UWORD                 Width;                     /* window size        */
  167.     UWORD                 Height;                    /* window size        */
  168.  
  169.     /* scaling information */
  170.  
  171.     UWORD                 FontX;                     /* scaling information: font width */
  172.     UWORD                 FontY;                     /* scaling information: font height */
  173.     struct TextAttr      *FontAttr;                  /* scaling information: font */
  174.     UWORD                 OffX;                      /* scaling information: x-offset */
  175.     UWORD                 OffY;                      /* scaling information: y-offset */
  176.  
  177.     /* more private stuff follows */
  178. };
  179.  
  180.  
  181. /*
  182.  
  183.    API clients designed for GoldED pass modification requests to GoldED in order to
  184.    edit the current text without using the ARexx interface. API modification requests
  185.    are attached to APIMessage structures (APIOrder slot).
  186.  
  187. */
  188.  
  189. struct APIModifyRequest {
  190.  
  191.     ULONG                 mr_Line;                   /* cursor line */
  192.     UWORD                 mr_Column;                 /* cursor column */
  193.     UBYTE                *mr_Data;                   /* modification request: data (cursor movement only if NULL) */
  194.     UWORD                 mr_Size;                   /* modification request: bytes */
  195. };
  196.  
  197. #endif
  198.